<?php
declare (strict_types = 1);

namespace app\middleware;

class Check
{
    /**
     * 处理请求
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {      
        // 获取用户登录信息，这里默认写死，模拟未登录
        $isLogin = false;

        if (!$isLogin) {
            return json(['msg'=>'未登录']);
        }

        return $next($request);
    }
}
